package unitTest;

import com.mic.yzzn.plc.common.control.RMI.PLCMaster;
import com.mic.yzzn.plc.common.control.datastructure.PLCCollectorControlCmd;

import java.rmi.Naming;

/**
 * Created by ASH on 16/4/26.
 */
public class MasterControlTest
{
    public static void main(String[] args)
    {
        PLCMaster master = null;
        String targetID = "222.201.167.253-9094-01"; // 要控制的采集器的ID

        try
        {
            master = (PLCMaster) Naming.lookup(PLCMaster.NAME);
            System.out.println(
                    master.controlCollector(
                            new PLCCollectorControlCmd(
                                    targetID,
                                    PLCCollectorControlCmd.PLCCmdTypeReboot, // 要发送的控制命令的类型
                                    0
                            ))
            );
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
